package com.zhongbei.service.impl;

import com.zhongbei.mapper.StudyMapper;
import com.zhongbei.pojo.Study;
import com.zhongbei.service.StudyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class StudyServiceImpl implements StudyService {

    @Autowired
    private StudyMapper studyMapper;

    @Override
    public int insertStudy(Study study) {
        return studyMapper.insertStudy(study);
    }

    @Override
    public int updateStudy(Study study) {
        return studyMapper.updateStudy(study.getStudyId(), study);
    }

    @Override
    public int deleteStudy(Integer studyId) {
        return studyMapper.deleteStudy(studyId);
    }

    @Override
    public List<Study> selectStudy() {
        return studyMapper.selectStudy();
    }

    @Override
    public List<Study> selectStudyByIsMandatory(Integer isMandatory) {
        return studyMapper.selectStudyByIsMandatory(isMandatory);
    }

    @Override
    public Study selectStudyByStudyId(Integer studyId) {
        return studyMapper.selectStudyByStudyId(studyId);
    }

    @Override
    public List<Study> selectStudyByStudyCategory(Integer studyCategory) {
        return studyMapper.selectStudyByStudyCategory(studyCategory);
    }
}
